export const downloadFile = (data: any, fileName = '模版.xlsx') => {
  // 将二进制文件转换为可访问的url
  // let blob = new Blob([data], { type: 'application/vnd.ms-excel' });
  const blob = new Blob([data]);
  const downloadElement = document.createElement('a');
  const href = window.URL.createObjectURL(blob);
  downloadElement.href = href;
  downloadElement.download = fileName;
  document.body.appendChild(downloadElement);
  downloadElement.click();
  document.body.removeChild(downloadElement);
  window.URL.revokeObjectURL(href);
};
